<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use backend\assets\AdminAsset;
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/shop/index.js'),AdminAsset::class);
?>

<div class="layui-card">
    <div class="layui-card-header">商家列表</div>
    <div class="layui-card-body">
        <form  class="layui-form" method="get" id="#form1">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">商家名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="shop_name"  autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">商家状态</label>
                    <div class="layui-input-inline">
                        <select name="status" id="status" lay-search="">
                            <option value="0" <?php if($status == 0):?> selected <?php endif;?>请选择商家状态</option>
                            <option value="1" <?php if($status == 1):?> selected <?php endif;?>>待审核</option>
                            <option value="2" <?php if($status == 2):?> selected <?php endif;?>>通过</option>
                            <option value="3" <?php if($status == 3):?> selected <?php endif;?>>驳回</option>
                            <option value="4" <?php if($status == 4):?> selected <?php endif;?>>关闭</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn" lay-submit lay-filter="serch-form">搜索</button>
                </div>
                <div class="layui-inline">
                    <a href="<?= GlobalUrlService::buildAdminUrl('shop/add-shop')?>" class="layui-btn layui-btn-normal addNews_btn ">添加商家</a>
                </div>
            </div>
        </form>
        <div class="layui-form-item">
            <table class="layui-hide" id="test"  lay-filter="barDemo"></table>
        </div>
    </div>
</div>

<script type="text/html" id="header">
    <img src="{{d.avatarurl}}"/>
</script>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs" lay-event="set-server">设置服务费率</a>
    {{# if(d.status == 0){ }}
    <a class="layui-btn layui-btn-xs" lay-event="set-status">通过</a>
    <a class="layui-btn layui-btn-xs" lay-event="reject">驳回</a>
    {{# }else if(d.status == 1){ }}
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="set-status">停用</a>
    {{# }else if(d.status == 3){ }}
    <a class="layui-btn layui-btn-xs" lay-event="set-status">启用</a>
    {{# } }}
</script>









